<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是蓝牙Mesh进阶——蓝牙Mesh模型的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型">
<meta property="og:url" content="https://sumumm.github.io/post/8bed8e87.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是蓝牙Mesh进阶——蓝牙Mesh模型的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227224001273.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227224243430.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20200529104401728.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20200529113532407.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20200529152059885.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230318232.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230347030.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230411410.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230557149.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230611502.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230625720.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230721078.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230736373.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230829983.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230839958.png">
<meta property="article:published_time" content="2024-01-07T03:45:33.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.027Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="LV21-天猫精灵IOT">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227224001273.png">


<link rel="canonical" href="https://sumumm.github.io/post/8bed8e87.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://sumumm.github.io/post/8bed8e87.html","path":"post/8bed8e87.html","title":"LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B%E7%AE%80%E4%BB%8B"><span class="nav-text">一、蓝牙Mesh模型简介</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E6%A8%A1%E5%9E%8B%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5"><span class="nav-text">1. 模型的基本概念</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E5%AE%98%E6%96%B9%E6%96%87%E6%A1%A3"><span class="nav-text">2. 官方文档</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E5%9F%BA%E7%A1%80%E6%A8%A1%E5%9E%8B"><span class="nav-text">二、基础模型</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E9%80%9A%E7%94%A8%E6%A8%A1%E5%9E%8B"><span class="nav-text">三、通用模型</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E9%80%9A%E7%94%A8%E6%A8%A1%E5%9E%8B%E7%A7%8D%E7%B1%BB"><span class="nav-text">1. 通用模型种类</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E9%80%9A%E7%94%A8%E6%9C%8D%E5%8A%A1%E6%A8%A1%E5%9E%8B%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E"><span class="nav-text">2. 通用服务模型字段说明</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E9%80%9A%E7%94%A8%E5%BC%80%E5%85%B3%E6%9C%8D%E5%8A%A1%E6%A8%A1%E5%9E%8B"><span class="nav-text">3. 通用开关服务模型</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E8%8E%B7%E5%8F%96%E5%BC%80%E5%85%B3%E7%8A%B6%E6%80%81"><span class="nav-text">3.1 获取开关状态</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-%E8%AE%BE%E7%BD%AE%E5%BC%80%E5%85%B3%E7%8A%B6%E6%80%81"><span class="nav-text">3.2 设置开关状态</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-3-%E8%AE%BE%E7%BD%AE%E5%BC%80%E5%85%B3%E7%8A%B6%E6%80%81%EF%BC%88%E6%97%A0%E7%A1%AE%E8%AE%A4%EF%BC%89"><span class="nav-text">3.3 设置开关状态（无确认）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-4-%E5%BC%80%E5%85%B3%E7%8A%B6%E6%80%81"><span class="nav-text">3.4 开关状态</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-Lighting-Server-%E6%A8%A1%E5%9E%8B"><span class="nav-text">4. Lighting Server 模型</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#4-1-Lightness-%E7%8A%B6%E6%80%81"><span class="nav-text">4.1 Lightness 状态</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-Light-Lightness-%E7%8A%B6%E6%80%81"><span class="nav-text">4.2 Light Lightness 状态</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-3-Light-Lightness-Actual-%E7%8A%B6%E6%80%81"><span class="nav-text">4.3 Light Lightness Actual 状态</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-4-Light-Lightness-Status-%E7%8A%B6%E6%80%81"><span class="nav-text">4.4 Light Lightness Status 状态</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%9B%9B%E3%80%81%E5%8E%82%E5%95%86%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A8%A1%E5%9E%8B"><span class="nav-text">四、厂商自定义模型</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E8%83%8C%E6%99%AF%E4%BF%A1%E6%81%AF"><span class="nav-text">1. 背景信息</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-Vendor-Model"><span class="nav-text">2. Vendor Model</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E6%89%A9%E5%B1%95%E6%B6%88%E6%81%AF%E6%93%8D%E4%BD%9C%E7%A0%81"><span class="nav-text">3. 扩展消息操作码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E6%93%8D%E4%BD%9C%E7%A0%81%E5%AE%9A%E4%B9%89"><span class="nav-text">4. 操作码定义</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-Vendor-Model%E5%B1%9E%E6%80%A7%E6%B6%88%E6%81%AF%E7%BB%93%E6%9E%84"><span class="nav-text">5. Vendor Model属性消息结构</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#5-1-Vendor-Message-Attribute-Get"><span class="nav-text">5.1 Vendor Message Attribute Get</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-2-Vendor-Message-Attribute-Set"><span class="nav-text">5.2 Vendor Message Attribute Set</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-3-Vendor-Message-Attribute-Set-Unacknowledged"><span class="nav-text">5.3 Vendor Message Attribute Set Unacknowledged</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-4-Vendor-Message-Attribute-Status"><span class="nav-text">5.4 Vendor Message Attribute Status</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-5-Vendor-Message-Attribute-Indication"><span class="nav-text">5.5 Vendor Message Attribute Indication</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-6-Vendor-Message-Attribute-Confirmation"><span class="nav-text">5.6 Vendor Message Attribute Confirmation</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-7-Vendor-Message-Attribute-Indication-To-TmallGenie"><span class="nav-text">5.7 Vendor Message Attribute Indication To TmallGenie</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-8-Vendor-Message-Attribute-Confirmation-From-TmallGenie"><span class="nav-text">5.8 Vendor Message Attribute Confirmation From TmallGenie</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-Vendor-Model%E9%80%8F%E4%BC%A0%E6%B6%88%E6%81%AF%E7%BB%93%E6%9E%84"><span class="nav-text">6. Vendor Model透传消息结构</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#6-1-Vendor-Message-Transparent-Message"><span class="nav-text">6.1 Vendor Message Transparent Message</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6-2-Vendor-Message-Transparent-Indication"><span class="nav-text">6.2 Vendor Message Transparent Indication</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6-3-Vendor-Message-Transparent-ACK"><span class="nav-text">6.3 Vendor Message Transparent ACK</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-Vendor-Message-%E7%A4%BA%E4%BE%8B%E6%95%B0%E6%8D%AE"><span class="nav-text">7. Vendor Message 示例数据</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#7-1-Vendor-Model-Client%E8%AE%BE%E7%BD%AE%E7%9B%AE%E6%A0%87%E6%B8%A9%E5%BA%A6"><span class="nav-text">7.1 Vendor Model Client设置目标温度</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7-2-Vendor-Model-Client%E8%AF%BB%E5%8F%96%E6%95%B0%E6%8D%AE"><span class="nav-text">7.2 Vendor Model Client读取数据</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7-3-Vendor-Model-Server%E4%B8%8A%E6%8A%A5%E6%B8%A9%E5%BA%A6"><span class="nav-text">7.3 Vendor Model Server上报温度</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7-4-Vendor-Model-Server%E4%B8%8A%E6%8A%A5%E6%BC%8F%E6%B0%B4%E6%95%85%E9%9A%9C"><span class="nav-text">7.4 Vendor Model Server上报漏水故障</span></a></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/8bed8e87.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2024-01-07 11:45:33" itemprop="dateCreated datePublished" datetime="2024-01-07T11:45:33+08:00">2024-01-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/" itemprop="url" rel="index"><span itemprop="name">01HQ课程体系</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" itemprop="url" rel="index"><span itemprop="name">LV21-天猫精灵IOT</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>8.7k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>31 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是蓝牙Mesh进阶——蓝牙Mesh模型的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>Windows版本</td>        <td align="left">windows11</td>    </tr>    <tr>        <td align="center">Ubuntu版本</td>        <td align="left">Ubuntu22.04的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 16 Pro</td>        <td align="left">16.2.3 build-19376536</td>      </tr>    <tr>        <td align="center">终端软件</td>        <td align="left">MobaXterm(Professional Edition v23.0 Build 5042 (license))</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="6">官方网站</td>        <td align="left"><a href="https://cn.aliyun.com/" target="_blank">阿里云</a></td>        <td align="left">阿里云官网主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/livinglink?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.317.5421154acZniIL&scm=20140722.X_data-1da961ea118f5bb0e4b2._.V_1" target="_blank">阿里生活物联平台</a></td>        <td align="left">生活物联网平台(飞燕平台)主页</td>    </tr>    <tr>        <td align="left"><a href="https://iap.aligenie.com/?spm=0.7629140.0.0.2c611780Ty6tzg" target="_blank">AliGenie</a></td>        <td align="left">天猫精灵开放平台AliGenie主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/iot_instc_public_cn?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.81.5421154au3ocqp&scm=20140722.X_data-9349178ba84cf028806a._.V_1" target="_blank">阿里物联网平台</a></td>        <td align="left">阿里物联网平台主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/" target="_blank">Bluetooth 技术网站</a></td>        <td align="left">蓝牙协议规范什么的可以来这里找</td>    </tr>    <tr>        <td align="left"><a href="https://www.telink-semi.com/" target="_blank">Telink</a></td>        <td align="left">Telink | Chips for a Smarter IoT (telink-semi.com)<br><a href="https://www.telink-semi.cn/" target="_blank">Telink中文官网</a></td>    </tr>    <tr>        <td align="center" rowspan="5">开发手册</td>        <td align="left"><a href="https://help.aliyun.com/zh/alios-things/" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things开发指南，这里是最新版本，可以直接从官网找到</td>    </tr>     <tr>        <td align="left"><a href="https://haas.iot.aliyun.com/aliosthings/index.html" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.3版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://gaic.alicdn.com/aic/h5_daily/test/aliosthings/3.0.13/index.html" target="_blank">AliOS Things开发指南(3.0)</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.0版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/product/123207.html?spm=a2c4g.11186623.6.540.114e60d84sF58G" target="_blank">生活物联网平台开发文档</a></td>        <td align="left">生活物联网平台（飞燕平台）开发文档<br><a href="https://help.aliyun.com/document_detail/180778.html?spm=a2c4g.123207.0.0.49556adcO5apvd" target="_blank">《设备端开发指南》</a></td>    </tr>    <tr>        <td align="left"><a href="https://doc-bot.tmall.com/docs/doc.htm?spm=0.7629140.0.0.7bf81780UN7WkQ&treeId=578&articleId=118057&docType=1" target="_blank">Wi-Fi IoT品类定义与功能开发</a></td>        <td align="left">天猫精灵IoT开放平台——Wi-Fi IoT品类定义与功能开发</td>    </tr>    <tr>        <td align="center" rowspan="3">硬件平台</td>        <td align="left"><a href="https://developer.aliyun.com/article/761644?spm=a2c6h.12873581.0.dArticle761644.1c1b589dRHgvcR&groupCode=genieaiot" target="_blank">mk3080 WiFi开发板</a></td>        <td align="left">WiFi开发板使用指南-阿里云开发者社区</td>    </tr>    <tr>        <td align="left"><a href="http://www.taichi-maker.com/homepage/esp8266-nodemcu-iot/esp8266-nodemcu-tutorial-index/" target="_blank">esp8266开发板</a></td>        <td align="left">一个教程：ESP8266-NodeMCU开发板详解-太极创客 (taichi-maker.com)</td>    </tr>    <tr>        <td align="left"><a href="https://wiki.telink-semi.cn/doc/ds/DS_TLSR8258-E_Datasheet%20for%20Telink%20BLE+IEEE802.15.4%20Multi-Standard%20Wireless%20SoC%20TLSR8258.pdf" target="_blank">TLSR8258 Datasheet</a></td>        <td align="left">Datasheet for Telink BLE + IEEE802.15.4 MultiStandard Wireless SoC TLSR8258</td>    </tr>    <tr>        <td align="center" rowspan="2">参考资料</td>        <td align="left"><a href="https://developer.aliyun.com/article/720516#" target="_blank">AliOS Things 3.0 应用开发指南</a></td>        <td align="left">这个只是一篇参考文章，里面是一些环境搭建相关的，可以参考</td>    </tr>    <tr>        <td align="left"><a href="https://info.support.huawei.com/info-finder/encyclopedia/zh/index.html" target="_blank">IP知识百科 - 华为 (huawei.com)</a></td>        <td align="left">IP的一些相关知识点</td>    </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="left" rowspan="6">蓝牙规范相关文档</td>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/core-specification-5-2/" target="_blank">Core Specification 5.2</a></td>        <td align="left">核心规格 5.2，该规范定义了创建可互操作的Bluetooth 设备所需的技术。                        <br><a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-model-1-1/" target="_blank">Mesh Model(v1.1)</a></td>        <td align="left">本Bluetooth 规范定义了模型（以及它们所需的状态和消息），这些模型用于在mesh 网络中的节点上执行基本功能，超出了Bluetooth Mesh 配置文件 规范中定义的基础模型。                        <br>本规范包括定义跨设备类型标准功能的通用模型，以及支持关键mesh 场景的模型，如照明控制、传感器、时间和场景。                        <br><a href="./蓝牙参考资料/MshMDL_v1.1.pdf" target="_blank">《MshMDL_v1.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-profile-1-0-1/" target="_blank">Mesh Profile(v1.0.1)</a></td>        <td align="left">该Bluetooth 规范定义了基本要求，以实现可互操作的mesh 网络解决方案，用于Bluetooth 低能量无线技术。                        <br><a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/device-properties/" target="_blank">Mesh Device Properties</a></td>        <td align="left">本规范包含Bluetooth Mesh 配置文件 和Bluetooth Mesh 模型规范所要求的设备属性的定义。                        <br>但是跟之前的有些区别，我主要看的之前的版本：<a href="./蓝牙参考资料/MeshDeviceProperties_v1.2.pdf" target="_blank">《MMeshDeviceProperties_v1.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/gss/" target="_blank">GATT Specification Supplement</a></td>        <td align="left">GATT Specification Supplement | Bluetooth® Technology Website。                        <br>好像可以在线看：<a href="https://btprodspecificationrefs.blob.core.windows.net/gatt-specification-supplement/GATT_Specification_Supplement.pdf" target="_blank">《GATT Specification Supplement》</a></td>      </tr>     <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/assigned-numbers/" target="_blank">Assigned Numbers</a></td>        <td align="left">GATT的一些类型定义可以在这里找。</td>      </tr>    <tr>        <td align="left" rowspan="2">AliOS Things</td>        <td align="left"><a href="https://gitee.com/alios-things-admin/AliOS-Things" target="_blank">alios-things/AliOS-Things</a></td>        <td align="left">Gitee上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left"><a href="https://github.com/alibaba/AliOS-Things" target="_blank">alibaba/AliOS-Things</a></td>        <td align="left">GitHub上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left" rowspan="2">天猫精灵蓝牙Mesh协议栈</td>        <td align="left"><a href="https://github.com/alibaba-archive/genie-bt-mesh-stack" target="_blank">alibaba-archive/genie-bt-mesh-stack</a></td>        <td align="left">GitHub上的天猫精灵蓝牙Mesh协议栈源码仓库。<br>之前是在<a href="https://github.com/alibaba/genie-bt-mesh-stack"target="_blank">alibaba/genie-bt-mesh-stack</a>这个仓库。<br>写笔记的时候最新提交为<a href="https://github.com/alibaba-archive/genie-bt-mesh-stack/tree/faf523618a6a2560090fc423222b9db80984bb7a" target="_blank">faf523618a6a2560090fc423222b9db80984bb7a</a></td>      </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/document_detail/171552.html?spm=a2c4g.173310.0.0.55d6e992e8xJip" target="_blank">蓝牙Mesh设备开发指南</a></td>        <td align="left">阿里云生活服务平台开发手册——蓝牙设备开发一节中的内容</td>      </tr></table>
              </div>
            </details>

<h1 id="一、蓝牙Mesh模型简介"><a href="#一、蓝牙Mesh模型简介" class="headerlink" title="一、蓝牙Mesh模型简介"></a><font size=3>一、蓝牙Mesh模型简介</font></h1><h2 id="1-模型的基本概念"><a href="#1-模型的基本概念" class="headerlink" title="1. 模型的基本概念"></a><font size=3>1. 模型的基本概念</font></h2><p>蓝牙Mesh模型（Model）是Mesh模型架构中的基础业务单元，每个模型其实就是对应一个功能，（也有可能多个模型组合对应一个特定功能），每个元素（Element）可以添加多个不同的模型相同的模型也可以存在一个设备的不同元素中，例如：一盏RGB的氛围灯，其中红（R）黄（G）蓝（B）每个颜色的Led为一个元素，一共三个元素，每个元素中分别可以包含通用开关模型、通用上下电等级模型等。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227224001273.png" alt="image-20231227224001273" style="zoom:50%;" />

<p>模型又分为服务模型(Server Model)和终端模型(Client Model)。我们在IoT设备上配置的模型均为服务模型，表示该设备具备有特定的业务能力。</p>
<p>蓝牙Mesh模型又分为三种不同的类型，分别是基础模型（Foundation Model）、通用模型（Generic Model），以及厂商模型（Vendor Model）。</p>
<h2 id="2-官方文档"><a href="#2-官方文档" class="headerlink" title="2. 官方文档"></a><font size=3>2. 官方文档</font></h2><p>关于模型，我们具体可以查看这篇文档：<a href="./蓝牙参考资料/MshMDL_v1.1.pdf" target="_blank">《MshMDL_v1.1.pdf》</a></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227224243430.png" alt="image-20231227224243430" style="zoom:50%;" />

<h1 id="二、基础模型"><a href="#二、基础模型" class="headerlink" title="二、基础模型"></a><font size=3>二、基础模型</font></h1><p>基础模型定义了用于配置和管理蓝牙Mesh网络的消息，分为配置模型（Configuration Model）和健康模型（Health Mesh）两个部分。其中配置模型仅存在于设备的主元素（Primary Element）上，其他元素不需要添加该模型；健康模型必须存在于设备的主元素上，其他元素可以根据需求决定是否添加该模型。</p>
<h1 id="三、通用模型"><a href="#三、通用模型" class="headerlink" title="三、通用模型"></a><font size=3>三、通用模型</font></h1><p>通用模型定义了一些列用于非特定功能的标准设备模型。例如：许多设备都具有开关功能，如风扇、电灯、插座等。这些设备都可以通过支持通用模型的开关模型来实现开关功能，而不用为每种类型的设备分别提供一个开关模型，这样也方便了不同厂商设备之间进行相互通信、控制。</p>
<h2 id="1-通用模型种类"><a href="#1-通用模型种类" class="headerlink" title="1. 通用模型种类"></a><font size=3>1. 通用模型种类</font></h2><p>通用模型分为通用服务模型和通用终端模型，要在设备上配置的通常为通用服务模型，通用服务模型一共有14种，如下表：</p>
<table>
<thead>
<tr>
<th>中文</th>
<th>英文</th>
</tr>
</thead>
<tbody><tr>
<td>通用开关服务模型</td>
<td>Generic OnOff Server Model</td>
</tr>
<tr>
<td>通用等级服务模型</td>
<td>Generic Level Server Model</td>
</tr>
<tr>
<td>通用默认渐变时间服务模型</td>
<td>Generic Default Transition Time Server Model</td>
</tr>
<tr>
<td>通用上下电开关服务模型</td>
<td>Generic Power OnOff Server Model</td>
</tr>
<tr>
<td>通用上下电开关设置服务模型</td>
<td>Generic Power OnOff Setup Server Model</td>
</tr>
<tr>
<td>通用上下电等级服务模型</td>
<td>Generic Power Level Server Model</td>
</tr>
<tr>
<td>通用上下电等级设置服务模型</td>
<td>Generic Power Level Setup Server Model</td>
</tr>
<tr>
<td>通用电池服务模型</td>
<td>Generic Battery Server Model</td>
</tr>
<tr>
<td>通用位置信息服务模型</td>
<td>Generic Location Server Model</td>
</tr>
<tr>
<td>通用位置信息设置服务模型</td>
<td>Generic Location Setup Server Model</td>
</tr>
<tr>
<td>通用用户自定义属性服务模型</td>
<td>Generic User Property Server Model</td>
</tr>
<tr>
<td>通用管理员属性服务模型</td>
<td>Generic Admin Proerty Server Model</td>
</tr>
<tr>
<td>通用制造商属性服务模型</td>
<td>Generic Manufacturer Proerty Server Model</td>
</tr>
<tr>
<td>通用终端属性服务模型</td>
<td>Generic Client Proerty Server Model</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</tbody></table>
<h2 id="2-通用服务模型字段说明"><a href="#2-通用服务模型字段说明" class="headerlink" title="2. 通用服务模型字段说明"></a><font size=3>2. 通用服务模型字段说明</font></h2><p>TID：用于应用层判断消息ID是否重复，该字段数值由应用层定义。</p>
<p>渐变时间：表示设备从一个状态变换到另一个状态所需要的时间，该字段在通用服务模型中长度为1字节，该字节的低6位表示渐变时间的具体数值（该6位的取值范围是0x00~0x3E）；该字节的高2位表示渐变时间的单位。</p>
<p>该字节数据格式如下图：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20200529104401728.png" alt="image-20200529104401728" />

<p>该字节对应的渐变时间单位为：</p>
<table>
<thead>
<tr>
<th>渐变字段高2位</th>
<th>渐变时间单位</th>
<th>渐变字段高2位</th>
<th>渐变时间单位</th>
</tr>
</thead>
<tbody><tr>
<td>0b00</td>
<td>100ms</td>
<td>0b10</td>
<td>10s</td>
</tr>
<tr>
<td>0b01</td>
<td>1s</td>
<td>0b11</td>
<td>10min</td>
</tr>
</tbody></table>
<p>例如：该字段为0x41，对应低6位为0x01，高2位为0x01，解析得到的时间为1×1s &#x3D; 1s。</p>
<p>延迟时间：表示设备从收到消息到消息开始执行变化的这段时间，该字段对应的实际延迟时间为该字段数值×单位步长5ms。例如：该字段为0x0A，解析得到的时间为10×5ms &#x3D; 50ms。</p>
<h2 id="3-通用开关服务模型"><a href="#3-通用开关服务模型" class="headerlink" title="3. 通用开关服务模型"></a><font size=3>3. 通用开关服务模型</font></h2><p>通用开关模型是一个根模型（Root Model），该模型支持广播和订阅。</p>
<p>通用开关模型定义了一种通用的开关控制方式，不同的设备可以使用同一个消息格式控制开关，实现了多个设备&#x2F;模型订阅同一地址时，可以通过向该地址发送开关控制执行来控制开关。</p>
<h3 id="3-1-获取开关状态"><a href="#3-1-获取开关状态" class="headerlink" title="3.1 获取开关状态"></a><font size=3>3.1 获取开关状态</font></h3><p>获取开关状态（Generic OnOff Get）消息用于获取当前元素的开始状态。当设备收到获取开关状态消息时，需要返回的开关状态消息。获取开关状态消息格式如下：</p>
<table>
<thead>
<tr>
<th>字段</th>
<th>字段长度（字节）</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>Opcode(操作码)</td>
<td>2</td>
<td>0x82 0x01（Get）</td>
</tr>
</tbody></table>
<h3 id="3-2-设置开关状态"><a href="#3-2-设置开关状态" class="headerlink" title="3.2 设置开关状态"></a><font size=3>3.2 设置开关状态</font></h3><p>设置开关状态（Generic OnOff Set）消息用于设置当前元素的开关状态。当设备收到设置开关状态消息时，需要回复开关状态消息。设置开关消息格式如下：</p>
<table>
<thead>
<tr>
<th>字段</th>
<th>字段长度（字节）</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>Opcode（操作码）</td>
<td>2</td>
<td>0x82 0x02</td>
</tr>
<tr>
<td>目标开关状态</td>
<td>1</td>
<td>需要设置的目标开关状态</td>
</tr>
<tr>
<td>TID</td>
<td>1</td>
<td>TID</td>
</tr>
<tr>
<td>渐变时间</td>
<td>1</td>
<td>渐变时间（可选字段）</td>
</tr>
<tr>
<td>延迟时间</td>
<td>1</td>
<td>延迟时间（可选字段）</td>
</tr>
</tbody></table>
<p>渐变时间和延迟时间必须一起设置，如果渐变时间存在，则延迟时间必须存在；反之亦然。</p>
<h3 id="3-3-设置开关状态（无确认）"><a href="#3-3-设置开关状态（无确认）" class="headerlink" title="3.3 设置开关状态（无确认）"></a><font size=3>3.3 设置开关状态（无确认）</font></h3><p>设置开关状态（无确认）（Generic OnOff Set Unacknowledged）消息用于设置当前元素的开关状态。当设备接收设置开关状态（无确认）消息时，不需要回复任何消息，设置开关状态（无确认）消息格式：</p>
<table>
<thead>
<tr>
<th>字段</th>
<th>字段长度（字节）</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>Opcode</td>
<td>2</td>
<td>0x82 0x03</td>
</tr>
<tr>
<td>目标开关状态</td>
<td>1</td>
<td>需要设置的开关状态</td>
</tr>
<tr>
<td>TID</td>
<td>1</td>
<td>TID</td>
</tr>
<tr>
<td>渐变时间</td>
<td>1</td>
<td>渐变时间（可选字段）</td>
</tr>
<tr>
<td>延迟时间</td>
<td>1</td>
<td>延迟时间（可选字段）</td>
</tr>
</tbody></table>
<h3 id="3-4-开关状态"><a href="#3-4-开关状态" class="headerlink" title="3.4 开关状态"></a><font size=3>3.4 开关状态</font></h3><p>开关状态（Generic OnOff Status）消息用于上报设备的开关状态。消息格式如下：</p>
<table>
<thead>
<tr>
<th>字段</th>
<th>字段长度（字节）</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>Opcode</td>
<td>2</td>
<td>0x82 0x04</td>
</tr>
<tr>
<td>当前开关状态</td>
<td>1</td>
<td>设备当前开关状态</td>
</tr>
<tr>
<td>目标开关状态</td>
<td>1</td>
<td>设备目标开关状态</td>
</tr>
<tr>
<td>剩余时间</td>
<td>1</td>
<td>设备切换到目标状态剩余时间</td>
</tr>
</tbody></table>
<p>目标开关状态和剩余时间必须一起返回，如果目标开关状态存在，则剩余时间必须存在，反之以然。</p>
<h2 id="4-Lighting-Server-模型"><a href="#4-Lighting-Server-模型" class="headerlink" title="4. Lighting Server 模型"></a><font size=3>4. Lighting Server 模型</font></h2><p>接下来一起分析一个官方提供好的智能灯得一个服务模型，在此之前我们可以先回顾一下元素、模型、状态、消息之间得关系。首先应该设想好4种消息的特点：</p>
<table>
<thead>
<tr>
<th>类型</th>
<th>特点</th>
</tr>
</thead>
<tbody><tr>
<td>GET</td>
<td>用于获取该属性的状态、接收方需要发送该属性Status消息作为回应、此消息不包含其他参数</td>
</tr>
<tr>
<td>SET</td>
<td>用于设置该属性的状态、接收方需要发送该属性的Status作为消息回应</td>
</tr>
<tr>
<td>Set Unacknowledged</td>
<td>用于设置该属性的状态、接收方不需要回应</td>
</tr>
<tr>
<td>Status</td>
<td>用于报告该属性的状态（包含但不限于当前状态、目标状态、剩余转换时间等）、接收方不用回应</td>
</tr>
</tbody></table>
<p>元素、模型和状态三者之间个关系：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20200529113532407.png" alt="image-20200529113532407" />

<p>Lighting Server模型定义了一组照明控制功能。此模型出包含了可调亮度及变色灯外，还包括一个允许由传感器触发特定行为的灯光控制模型，例如，根据人的位置开启灯光、根据环境光线调整灯光亮度，或在一段时间没任何东京的情况下调暗灯光并最终关闭。</p>
<p>接下来将针对Light Lightness 及Light CTL这两个符合状态模型及其状态进行详细描述。</p>
<p>在蓝牙Mesh网络中，Provision一般时提供属性给Provisioner进行操作的一方，属于Server角色，其中包含的模型即为Server模型。Lighting Server模型是由LightLightness Server、Light Lightness Setup Server、Light CTL Server、Light CTL Setup Server、Light CTL Temperature Server、Light HSL Server、Light HSL Hue Server、Light HSL Saturation Server、Light HSL Setup Server、Light xyL Server和Light xyL Setup Server这11种模型组成。其中前四种应用最为广泛，本次也主要与前4种模型相关的状态、消息及各种操作消息对应的行为。</p>
<p>不同的模型之间存在继承和共生关系。以Light Lightness Server模型为例，它扩展了Generic OnOff Server 和Generic Level Server两种模型，这种扩展关系即集成关系；如果一个元素中包含Light Lightness Server模型，则必须包含Light Lightness Set Server模型，这种关系叫做共生关系。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20200529152059885.png" alt="image-20200529152059885" />

<p>上图所示：Light Lighteness Server Model、Light Lighteness Setup Server Model、Light CTL Server Model、Light CTL Setup Server Model模型与其他模型之间的关系。</p>
<p>其中Light Lighteness Server Model模型和Light CTL Server Model模型同事支持注册和发布操作；而Light Lighteness Setup Server Model和Light CTL Setup Server Model模型仅支持注册操作，这些模型所包含的状态如下：</p>
<h3 id="4-1-Lightness-状态"><a href="#4-1-Lightness-状态" class="headerlink" title="4.1 Lightness 状态"></a><font size=3>4.1 Lightness 状态</font></h3><p>Lightness状态时Lighting模型种应用最为广泛的一组符合状态。因为光源的类型及属性不同，所以在描述Lightness状态时会有所不同的表达方式。最简单的灯只有开和关两种状态，通过Generic OnOff描述和控制其他开关状态。高级一点的灯可以改变亮度，通过Light Lightness Actual描述和控制其亮度状态。</p>
<p>除此之外，还有变色灯，可以通过Light CTL 和DUV（Delta UV）来描述和调节其色温。对于变色灯，可以通过调整亮度、色调、饱和度三个维度的值对其颜色进行调整，三个维度都可以被独立控制。</p>
<h3 id="4-2-Light-Lightness-状态"><a href="#4-2-Light-Lightness-状态" class="headerlink" title="4.2 Light Lightness 状态"></a><font size=3>4.2 Light Lightness 状态</font></h3><p>Light Lightness状态是一个由Light Lightness Actual、Light Lightness Linear、LightLightness Last和Light Lightness Default组合成的符合状态。这4种状态都分别与其他一种或者多种状态存在绑定关系。可以理解为联动关系。</p>
<h3 id="4-3-Light-Lightness-Actual-状态"><a href="#4-3-Light-Lightness-Actual-状态" class="headerlink" title="4.3 Light Lightness Actual 状态"></a><font size=3>4.3 Light Lightness Actual 状态</font></h3><table>
<thead>
<tr>
<th>取值</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>0x0000</td>
<td>元素处于未发光状态</td>
</tr>
<tr>
<td>0x0001 ~ 0xFFFF</td>
<td>元素发出的被实际感知的光强度</td>
</tr>
<tr>
<td>0xFFFF</td>
<td>元素所能发射的能被感知的最强光的强度</td>
</tr>
</tbody></table>
<p>与Light Lightness Actual状态操作对应的是Light Lightness消息。Light Lightness状态属于可设置状态，所以Light Lightness消息由Light Lightness Set、Light Lightness Get、Light Lightness Set Unacknowledged、和Light Lightness Status这4种消息组成。</p>
<p>Light Lightness Set、Light Lightness Set Unacknowledged具有相同结构：</p>
<table>
<thead>
<tr>
<th>字段</th>
<th>大小（字节）</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>光亮度值</td>
<td>2</td>
<td>Light Lighness Actual状态的目标值</td>
</tr>
<tr>
<td>TID</td>
<td>1</td>
<td>传输标识，可以用此字段判定当前收到的消息是一条新消息还是重传消息</td>
</tr>
<tr>
<td>状态切换时间</td>
<td>1</td>
<td>可选</td>
</tr>
<tr>
<td>状态切换延迟</td>
<td>1</td>
<td>开始状态切换时间必须添加此项</td>
</tr>
</tbody></table>
<p>Light Lightness Server在收到这两种消息后，应该将Light Lighness Actual状态设置为Lightness目标值。如果6s内收到SRC、DST、TID栏位都相同，的多条消息，可以忽略掉第1条消息之后的其他消息。</p>
<p>如果消息种包含“状态转换时间”字段，则元素状态切换应该符合该字段定义的行为，如果不包含“状态转换时间”字段，但元素支持“Generic Default Transition”状态的情况下，元素状态切换应该符合“Generic Default Transition”状态的行为定义，否则状态将立即执行。</p>
<p>如果当前状态和目标状态是一致的话，应该认为状态切换过程已经完成。</p>
<p>在收到Light Lightness Set消息之后，Light Lightness Server应该回复Light Lightness Status消息给发送方。</p>
<h3 id="4-4-Light-Lightness-Status-状态"><a href="#4-4-Light-Lightness-Status-状态" class="headerlink" title="4.4 Light Lightness Status 状态"></a><font size=3>4.4 Light Lightness Status 状态</font></h3><table>
<thead>
<tr>
<th>字段</th>
<th>大小（字节）</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td>当前亮度</td>
<td>2</td>
<td align="left">Light lightness Actual 当前状态值</td>
</tr>
<tr>
<td>目标亮度</td>
<td>2</td>
<td align="left">Light lightness Actual 目标值（可选）如果元素处于状态切换过程中，则需要包含此项，代表元素的目标亮度值</td>
</tr>
<tr>
<td>剩余状态                           切换时间</td>
<td>1</td>
<td align="left">需要与“目标状态”字段同时出现                                                                                               代表元素完成状态切换过程所剩余的时间</td>
</tr>
</tbody></table>
<h1 id="四、厂商自定义模型"><a href="#四、厂商自定义模型" class="headerlink" title="四、厂商自定义模型"></a><font size=3>四、厂商自定义模型</font></h1><p>关于这一部分，官方有相关的说明：<a target="_blank" rel="noopener" href="https://help.aliyun.com/document_detail/173311.html?spm=a2c4g.173319.0.0.71586d7fA4pgmD">蓝牙Mesh设备扩展协议_生活物联网平台（飞燕平台）-阿里云帮助中心 (aliyun.com)</a></p>
<h2 id="1-背景信息"><a href="#1-背景信息" class="headerlink" title="1. 背景信息"></a><font size=3>1. 背景信息</font></h2><p>蓝牙技术联盟（Bluetooth SIG）定义的SIG Mesh的模型目前尚未覆盖所有的智能家居设备，我们采用厂商自定义模型（Vendor Model）来实现智能家居设备的控制和状态上报。在天猫精灵生态项目中，Mesh网关包括天猫精灵音箱与天猫精灵App。在自有品牌项目中，Mesh网关包括自有品牌项目Mesh网关产品与云智能App。注意以下部分消息仅在天猫精灵生态项目中支持。</p>
<h2 id="2-Vendor-Model"><a href="#2-Vendor-Model" class="headerlink" title="2. Vendor Model"></a><font size=3>2. Vendor Model</font></h2><p>SIG定义Vendor Model格式为4字节（其中2字节的Company ID和2字节的Vendor-assigned Model ID），其中Alibaba的Company ID为0x01A8，如下表所示。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">16-bit Company Identifier</td>
<td align="left">2</td>
<td align="left">0x01A8</td>
</tr>
<tr>
<td align="left">16-bit vendor-assigned model Identifier</td>
<td align="left">2</td>
<td align="left">-</td>
</tr>
</tbody></table>
<p>下表为两个VendorModel ID，用于消息扩展用。</p>
<table>
<thead>
<tr>
<th align="left">Model Name</th>
<th align="left">SIG Model ID</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Vendor Model Server</td>
<td align="left">0x01A80000</td>
</tr>
<tr>
<td align="left">Vendor Model Client</td>
<td align="left">0x01A80001</td>
</tr>
</tbody></table>
<blockquote>
<p><strong>说明</strong> Mesh设备作为Vendor Model Server，Mesh网关作为Vendor Model Client。</p>
</blockquote>
<h2 id="3-扩展消息操作码"><a href="#3-扩展消息操作码" class="headerlink" title="3. 扩展消息操作码"></a><font size=3>3. 扩展消息操作码</font></h2><p>在蓝牙Mesh协议中规定，操作码分为3种：1字节Opcode、2字节Opcode、3字节Opcode。</p>
<ul>
<li>1字节Opcode的最高位为0，所以1字节Opcode的取值范围从0x00-0x7e（其中0x7f用于将来扩展用）。</li>
<li>2字节Opcode第一字节的最高位为1，第2位为0，所以2字节OpCode的取值范围从0x8000到0xbfff，都为SIG分配。</li>
<li>3字节Opcode第一字节的最高两位均为1，后两字节<strong>z</strong>是由SIG分配的Company ID，Company ID使用小端优先的方式传输，阿里巴巴使用的Company ID为0x01a8。6 bit的<strong>x</strong>可由厂商定义64个Opcodes。</li>
</ul>
<table>
<thead>
<tr>
<th align="left">Opcode Format</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">0b0xxxxxxx（排除0b01111111）</td>
<td align="left">1字节Opcode。</td>
</tr>
<tr>
<td align="left">0b01111111</td>
<td align="left">保留，用于将来扩展。</td>
</tr>
<tr>
<td align="left">0b10xxxxxx xxxxxxxx</td>
<td align="left">2字节Opcode。</td>
</tr>
<tr>
<td align="left">0b11xxxxxx zzzzzzzz zzzzzzzz</td>
<td align="left">3字节Opcode。</td>
</tr>
</tbody></table>
<h2 id="4-操作码定义"><a href="#4-操作码定义" class="headerlink" title="4. 操作码定义"></a><font size=3>4. 操作码定义</font></h2><p>智能生活平台蓝牙Mesh扩展消息Opcode定义如下表所示。</p>
<table>
<thead>
<tr>
<th align="left">Vendor Message Name</th>
<th align="left">Opcode</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Vendor Message Attribute Get</td>
<td align="left">0xD001A8</td>
</tr>
<tr>
<td align="left">Vendor Message Attribute Set</td>
<td align="left">0xD101A8</td>
</tr>
<tr>
<td align="left">Vendor Message Attribute Set Unacknowledged</td>
<td align="left">0xD201A8</td>
</tr>
<tr>
<td align="left">Vendor Message Attribute Status</td>
<td align="left">0xD301A8</td>
</tr>
<tr>
<td align="left">Vendor Message Attribute Indication</td>
<td align="left">0xD401A8</td>
</tr>
<tr>
<td align="left">Vendor Message Attribute Confirmation</td>
<td align="left">0xD501A8</td>
</tr>
<tr>
<td align="left">Vendor Message Attribute Indication To Tmall Genie</td>
<td align="left">0xDE01A8</td>
</tr>
<tr>
<td align="left">Vendor Message Attribute Confirmation From Tmall Genie</td>
<td align="left">0xDF01A8</td>
</tr>
<tr>
<td align="left">Vendor Message Transparent msg</td>
<td align="left">0xCF01A8</td>
</tr>
<tr>
<td align="left">Vendor Message Transparent Indication</td>
<td align="left">0xCE01A8</td>
</tr>
<tr>
<td align="left">Vendor Message Transparent ACK</td>
<td align="left">0xCD01A8</td>
</tr>
</tbody></table>
<h2 id="5-Vendor-Model属性消息结构"><a href="#5-Vendor-Model属性消息结构" class="headerlink" title="5. Vendor Model属性消息结构"></a><font size=3>5. Vendor Model属性消息结构</font></h2><p>Vendor message里的数据都使用小端优先方式传输。</p>
<h3 id="5-1-Vendor-Message-Attribute-Get"><a href="#5-1-Vendor-Message-Attribute-Get" class="headerlink" title="5.1 Vendor Message Attribute Get"></a><font size=3>5.1 Vendor Message Attribute Get</font></h3><p>该消息用于Vendor Model Client获取Vendor Model Server的一个或多个属性值，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xD001A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增</td>
</tr>
<tr>
<td align="left">Attribute Type</td>
<td align="left">2</td>
<td align="left">读取的Attribute类型</td>
</tr>
</tbody></table>
<p>Attribute Type最多可有15个。当Vendor Model Server收到Attribute Get消息后，必须向Vendor Model Client回复Attribute Status。如Vendor Model Client在下发该命令之后未收到Vendor Model Server返回的Attribute Status，可以再次下发该指令。</p>
<h3 id="5-2-Vendor-Message-Attribute-Set"><a href="#5-2-Vendor-Message-Attribute-Set" class="headerlink" title="5.2 Vendor Message Attribute Set"></a><font size=3>5.2 Vendor Message Attribute Set</font></h3><p>该消息用于Vendor Model Client设置Vendor Model Server的一个或多个属性值，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xD101A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增</td>
</tr>
<tr>
<td align="left">Attribute Type</td>
<td align="left">2</td>
<td align="left">设置的Attribute类型</td>
</tr>
<tr>
<td align="left">Attribute Parameter</td>
<td align="left">N</td>
<td align="left">设置的Attribute参数</td>
</tr>
</tbody></table>
<p>Attribute Type和Attribute Parameter最多可有15个。当Vendor Model Server收到Attribute Set消息后，必须向Vendor Model Client回复Attribute Status。如Vendor Model Client在下发该命令之后未收到Vendor Model Server返回的Attribute Status，可以再次下发该指令。</p>
<h3 id="5-3-Vendor-Message-Attribute-Set-Unacknowledged"><a href="#5-3-Vendor-Message-Attribute-Set-Unacknowledged" class="headerlink" title="5.3 Vendor Message Attribute Set Unacknowledged"></a><font size=3>5.3 Vendor Message Attribute Set Unacknowledged</font></h3><p>该消息用于Vendor model Client设置Vendor Model Server的一个或多个属性值，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xD201A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增</td>
</tr>
<tr>
<td align="left">Attribute Type</td>
<td align="left">2</td>
<td align="left">设置的Attribute类型</td>
</tr>
<tr>
<td align="left">Attribute Parameter</td>
<td align="left">N</td>
<td align="left">设置的Attribute参数</td>
</tr>
</tbody></table>
<p>Attribute Type和Attribute Parameter最多可有15个。当Vendor Model Server收到Attribute Set Unacknowledged消息后，不需要向Vendor Model Client发送Attribute Status消息。</p>
<h3 id="5-4-Vendor-Message-Attribute-Status"><a href="#5-4-Vendor-Message-Attribute-Status" class="headerlink" title="5.4 Vendor Message Attribute Status"></a><font size=3>5.4 Vendor Message Attribute Status</font></h3><p>该消息用于Vendor Model Server回复Attribute Get和Attribute Set命令或上报设备状态信息给Vendor Model Client，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xD301A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增</td>
</tr>
<tr>
<td align="left">Attribute Type</td>
<td align="left">2</td>
<td align="left">上报的Attribute类型</td>
</tr>
<tr>
<td align="left">Attribute Parameter</td>
<td align="left">N</td>
<td align="left">上报的Attribute参数</td>
</tr>
</tbody></table>
<p>Vendor Model Client收到Attribute Status后，不需要回复消息给Vendor Model Server。</p>
<h3 id="5-5-Vendor-Message-Attribute-Indication"><a href="#5-5-Vendor-Message-Attribute-Indication" class="headerlink" title="5.5 Vendor Message Attribute Indication"></a><font size=3>5.5 Vendor Message Attribute Indication</font></h3><p>该消息用于Vendor Model Server发送属性给Vendor Model Client，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xD401A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增，回复控制命令的TID为下发消息的TID；设备状态主动改变上报的TID从128到191循环。</td>
</tr>
<tr>
<td align="left">Attribute Type</td>
<td align="left">2</td>
<td align="left">上报的Attribute类型</td>
</tr>
<tr>
<td align="left">Attribute Parameter</td>
<td align="left">N</td>
<td align="left">上报的Attribute参数</td>
</tr>
</tbody></table>
<p>Attribute Type和Attribute Parameter最多可有15个。当Vendor Model Client收到Attribute Indication消息后，必须向Vendor Model Server回复Attribute Confirmation。如Vendor Model Server在发出该命令之后未收到Vendor Model Client回复的confirmation，可以再次发送该指令。</p>
<h3 id="5-6-Vendor-Message-Attribute-Confirmation"><a href="#5-6-Vendor-Message-Attribute-Confirmation" class="headerlink" title="5.6 Vendor Message Attribute Confirmation"></a><font size=3>5.6 Vendor Message Attribute Confirmation</font></h3><p>该消息用于Vendor Model Client回复给Vendor Model Server，用于表示已收到Vendor Model Server发出的Indication，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xD501A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，收到的Indication消息的TID</td>
</tr>
</tbody></table>
<p>Vendor Model Server收到Attribute Confirmation后，不需要回复消息给Vendor Model Client。</p>
<h3 id="5-7-Vendor-Message-Attribute-Indication-To-TmallGenie"><a href="#5-7-Vendor-Message-Attribute-Indication-To-TmallGenie" class="headerlink" title="5.7 Vendor Message Attribute Indication To TmallGenie"></a><font size=3>5.7 Vendor Message Attribute Indication To TmallGenie</font></h3><p>该消息用于天猫精灵生态项目Vendor Model Server发送属性给Vendor Model Client，该消息由天猫精灵音箱直接处理，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xDE01A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增</td>
</tr>
<tr>
<td align="left">Attribute Type</td>
<td align="left">2</td>
<td align="left">上报的Attribute类型</td>
</tr>
<tr>
<td align="left">Attribute Parameter</td>
<td align="left">N</td>
<td align="left">上报的Attribute参数</td>
</tr>
</tbody></table>
<p>Attribute Type和Attribute Parameter最多可有15个。当Vendor Model Client收到Attribute Indication消息后，必须向Vendor Model Server回复Attribute Confirmation。如Vendor Model Server在发出该命令之后未收到Vendor Model Client回复的Confirmation，可以再次发送该指令。</p>
<h3 id="5-8-Vendor-Message-Attribute-Confirmation-From-TmallGenie"><a href="#5-8-Vendor-Message-Attribute-Confirmation-From-TmallGenie" class="headerlink" title="5.8 Vendor Message Attribute Confirmation From TmallGenie"></a><font size=3>5.8 Vendor Message Attribute Confirmation From TmallGenie</font></h3><p>该消息用于天猫精灵生态项目Vendor Model Client回复给Vendor Model Server，用于表示天猫精灵音箱已收到Vendor Model Server发出的Indication，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xDF01A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增</td>
</tr>
<tr>
<td align="left">Attribute Type</td>
<td align="left">2</td>
<td align="left">设置的Attribute类型</td>
</tr>
<tr>
<td align="left">Attribute Parameter</td>
<td align="left">N</td>
<td align="left">设置的Attribute参数</td>
</tr>
</tbody></table>
<p>Attribute Type和Attribute Parameter的个数从0到15。Vendor Model Server收到Attribute Confirmation后，不需要回复消息给Vendor Model Client。</p>
<blockquote>
<p><strong>说明</strong> TID：对于TID相同的消息，需按照协议回复对应的消息，但应用层是否处理则由产品自身特性决定。</p>
</blockquote>
<h2 id="6-Vendor-Model透传消息结构"><a href="#6-Vendor-Model透传消息结构" class="headerlink" title="6. Vendor Model透传消息结构"></a><font size=3>6. Vendor Model透传消息结构</font></h2><p>Vendor message里的数据都使用小端优先方式传输。</p>
<h3 id="6-1-Vendor-Message-Transparent-Message"><a href="#6-1-Vendor-Message-Transparent-Message" class="headerlink" title="6.1 Vendor Message Transparent Message"></a><font size=3>6.1 Vendor Message Transparent Message</font></h3><p>该消息用于Mesh设备与天猫精灵音箱与天猫精灵App之间透传数据，Payload数据格式由各厂家自己实现。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xCF01A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增，回复控制命令的TID为下发消息的TID；设备状态主动改变上报的TID从0到255循环。</td>
</tr>
<tr>
<td align="left">Payload</td>
<td align="left">N</td>
<td align="left">由厂商自定义</td>
</tr>
</tbody></table>
<h3 id="6-2-Vendor-Message-Transparent-Indication"><a href="#6-2-Vendor-Message-Transparent-Indication" class="headerlink" title="6.2 Vendor Message Transparent Indication"></a><font size=3>6.2 Vendor Message Transparent Indication</font></h3><p>该消息用于天猫精灵生态项目中Vendor Model Server发送属性给Vendor Model Client，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xCE01A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，每条新消息递增，回复控制命令的TID为下发消息的TID；设备状态主动改变上报的TID从128到191循环。</td>
</tr>
<tr>
<td align="left">Payload</td>
<td align="left">N</td>
<td align="left">由厂商自定义</td>
</tr>
</tbody></table>
<h3 id="6-3-Vendor-Message-Transparent-ACK"><a href="#6-3-Vendor-Message-Transparent-ACK" class="headerlink" title="6.3 Vendor Message Transparent ACK"></a><font size=3>6.3 Vendor Message Transparent ACK</font></h3><p>该消息用于天猫精灵生态项目中Vendor Model Client回复给Vendor Model Server，用于表示已收到Vendor Model Server发出的Transparent Indication，消息格式如下。</p>
<table>
<thead>
<tr>
<th align="left">字段</th>
<th align="left">字节数</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Opcode</td>
<td align="left">3</td>
<td align="left">0xCD01A8</td>
</tr>
<tr>
<td align="left">TID</td>
<td align="left">1</td>
<td align="left">Transaction Identifier，收到的Indication消息的TID。</td>
</tr>
</tbody></table>
<blockquote>
<p><strong>说明</strong> TID：对于TID相同的消息，需按照协议回复对应的消息，但应用层是否处理则由产品自身特性决定。</p>
</blockquote>
<h2 id="7-Vendor-Message-示例数据"><a href="#7-Vendor-Message-示例数据" class="headerlink" title="7. Vendor Message 示例数据"></a><font size=3>7. Vendor Message 示例数据</font></h2><h3 id="7-1-Vendor-Model-Client设置目标温度"><a href="#7-1-Vendor-Model-Client设置目标温度" class="headerlink" title="7.1 Vendor Model Client设置目标温度"></a><font size=3>7.1 Vendor Model Client设置目标温度</font></h3><p>本示例为Vendor Model Client设置目标温度为22摄氏度。</p>
<ul>
<li>Vendor Model Client下发设置目标温度的Attribute Set命令。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230318232.png" alt="image-20231227230318232" />

<ul>
<li>Vendor Model Server设置目标温度成功时返回的Attribute Status如下</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230347030.png" alt="image-20231227230347030" />

<ul>
<li>Vendor Model Server设置目标温度失败时返回的Attribute Status如下。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230411410.png" alt="image-20231227230411410" />

<h3 id="7-2-Vendor-Model-Client读取数据"><a href="#7-2-Vendor-Model-Client读取数据" class="headerlink" title="7.2 Vendor Model Client读取数据"></a><font size=3>7.2 Vendor Model Client读取数据</font></h3><p>本示例为Vendor Model Client读取前后位置，当前温度，当前湿度。</p>
<ul>
<li>Vendor Model Client发送Attribute Get读取前后位置、当前温度、当前湿度属性的值如下。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230557149.png" alt="image-20231227230557149" />

<ul>
<li>Vendor Model Server读取三个属性成功时返回的Attribute Status如下。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230611502.png" alt="image-20231227230611502" />

<ul>
<li>Vendor Model Server读取温度失败时返回的Attribute Status如下。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230625720.png" alt="image-20231227230625720" />

<h3 id="7-3-Vendor-Model-Server上报温度"><a href="#7-3-Vendor-Model-Server上报温度" class="headerlink" title="7.3 Vendor Model Server上报温度"></a><font size=3>7.3 Vendor Model Server上报温度</font></h3><p>本示例为Vendor Model Server发送温度给Vendor Model Client。</p>
<ul>
<li>Vendor Model Server发送Attribute Indication上报温度如下。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230721078.png" alt="image-20231227230721078" />

<ul>
<li>Vendor Model Client收到Attribute Indication后发送Confirmation如下。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230736373.png" alt="image-20231227230736373" />

<h3 id="7-4-Vendor-Model-Server上报漏水故障"><a href="#7-4-Vendor-Model-Server上报漏水故障" class="headerlink" title="7.4 Vendor Model Server上报漏水故障"></a><font size=3>7.4 Vendor Model Server上报漏水故障</font></h3><p>本示例为Vendor Model Server上报漏水故障给Vendor Model Client。</p>
<ul>
<li>Vendor Model Server发送Attribute Indication上报漏水故障如下。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230829983.png" alt="image-20231227230829983" />

<ul>
<li>Vendor Model Client收到Attribute Indication后发送Confirmation如下。</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV03-03-%E8%93%9D%E7%89%99Mesh%E8%BF%9B%E9%98%B6-03-%E8%93%9D%E7%89%99Mesh%E6%A8%A1%E5%9E%8B/img/image-20231227230839958.png" alt="image-20231227230839958" />

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/8bed8e87.html">LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2024年01月07日 - 11:45</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/8bed8e87.html" title="LV03-03-蓝牙Mesh进阶-03-蓝牙Mesh模型">https://sumumm.github.io/post/8bed8e87.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" rel="tag"><i class="fa fa-tag"></i> LV21-天猫精灵IOT</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/e0ca430.html" rel="prev" title="LV03-04-天猫蓝牙Mesh开发-01-环境搭建">
                  <i class="fa fa-angle-left"></i> LV03-04-天猫蓝牙Mesh开发-01-环境搭建
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/f96bb716.html" rel="next" title="LV03-03-蓝牙Mesh进阶-02-蓝牙Mesh配网流程">
                  LV03-03-蓝牙Mesh进阶-02-蓝牙Mesh配网流程 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
